package com.vcms.view.simulation.uicomponent.listener;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

/**
 * Title:        VMCS
 * Description:
 * Copyright:    Copyright (c) 2001
 * Company:      ISS
 * @author Pang Pingli
 * @version 1.0
 */

import java.awt.*;

import com.vcms.controller.maintenance.MaintenanceController;

public class DrinkDisplayListener implements ActionListener {

	private MaintenanceController mCtrl;

	public DrinkDisplayListener(MaintenanceController mctrl) {
		mCtrl = mctrl;
	}

	public void actionPerformed(ActionEvent e) {
		Button btn;
		String cmd;
		int idx;

		btn = (Button) e.getSource();
		cmd = btn.getActionCommand();
		idx = Integer.parseInt(cmd);

		mCtrl.displayDrinks(idx);
	}

}